<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<%
	request.setAttribute("modelConfigPath", "cargo");
%>
<%@ include file="/WEB-INF/views/shared/master/contentHeader.jsp"%>

	
<t:panel cssClass="panel-flat form-detailed" customBody="true" customHead="true">
	<div class="detailed-navbar-content panel-body">
		<t:form modelAttribute="category" action="/cargo/category/save" method="post" cssClass="form-horizontal">
			<div class="hide">
				 <t:hidden path="categoryId"/>
 				 <t:hidden path="deleteMark"/>	
 				 <t:hidden path="createUserName"/>
		 		 <t:hidden path="createUserId"/>
		 		 <t:hidden path="createDate"/>
		 		 <t:hidden path="shopId"/>
			</div>
       
     
            <t:formgroup>
                <t:label path="categoryName" cssClass="col-xs-2" />
                <t:input path="categoryName" colClass="col-xs-10" />
            </t:formgroup>

       
		</t:form>
	</div>
	<t:panelFoot headingBtnCssClass="heading-btn pull-right-important">
		<t:button icon="icon-floppy-disk" onclick="saveData()" laddaType="progress" cssClass="btn-info" csize="sm">保存</t:button>
	</t:panelFoot>
</t:panel>


<c:forEach var="inStock" items="${inStocks}" varStatus="status">
<div class="row row-sortable" style="margin-top:10px;">
	<div class="col-md-12">
		<div class="panel panel-white">
			<div class="panel-heading">
				<h6 class="panel-title">入库记录</h6>
				<div class="heading-elements">
					<ul class="icons-list">
                		<li><a data-action="collapse"></a></li>      
                		<li>
                			<t:button icon="icon-floppy-disk" onclick="printer('${inStock.inStockId}')" laddaType="progress" cssClass="btn-info" csize="sm">打印</t:button>  
                			<t:button icon="icon-cancel-square position-left" onclick="toVoid('${inStock.inStockId}')" laddaType="progress" cssClass="btn-info" csize="sm">作废</t:button>       		
						</li>      
                	</ul>
               	</div>
			</div>
			<div class="table-responsive">
				<p style="margin:20px">入库日期：<fmt:formatDate value="${inStock.createDate}" type="date" dateStyle="default" pattern="YYYY-MM-dd HH:mm"/></p>
				<table class="cntable table table-bordered  " style="margin-top:10px">	
					
					<thead>
						<tr class="success" >
							<th style="width:50px">序号</th>
							<th style="width:120px">商品编码</th>
							<th style="width:120px">商品名称</th>
							<th style="width:120px">规格</th>
							<th style="width:120px">单位</th>
							<th style="width:120px">采购数</th>
							
							<th style="width:120px">本次入库数</th>
						</tr>
					</thead>
					<tbody >
						<c:forEach var="inStockShow" items="${inStock.inStockShows}" varStatus="status">
							<c:forEach var="inStockcollocation" items="${inStockShow.inStockCollocations}" varStatus="status">
							<tr >
								<td>${status.index+1 }</td>
								<td>${inStockShow.cargo.cargoNo }</td>
								<td>${inStockShow.cargo.cargoName }</td>
								<td>${inStockcollocation.collocation.propertyNameOne }/${inStockcollocation.collocation.propertyNameTwo }</td>
								<td>${inStockShow.cargo.unit }</td>
								<td>${inStockcollocation.purchaseCollocation.purchaseNumber }</td>
													
								<td>
									${inStockcollocation.collocationNum }
								</td>
							</tr>
						</c:forEach>	
						</c:forEach>	
					</tbody>
					<tfoot >
						<tr style="height:20px" >
							<th colspan="8"> </th>
						</tr>
					</tfoot>
				</table>    
				<div ><label  style="font-size:1.2em;margin-left:20px;margin-bottom:50px">入库单号：${inStock.inStockNo }</label> 	<label  style="font-size:1.2em;margin-left:20px">入库仓：${inStock.warehouse }</label> 	<label  style="font-size:1.2em;margin-left:20px">经办人：${inStock.createUserName }</label> <label  style="font-size:1.2em;margin-left:20px">入库备注：${inStock.comment }</label> 		</div>
							
			</div>
		</div>
		
	</div>
	
</div>
</c:forEach>

<script type="text/javascript">

function saveData(lBtn){
	if (!$("form:first").valid()){
		return;
	}
	lBtn.start();
	$("form:first").submit();
}	


</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/jqueryui.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formtags.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formbuttons.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formpickers.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formselects.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/formstyling.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/dialog.jsp"%>
<%@ include file="/WEB-INF/views/shared/master/contentFooter.jsp"%>
